{load header}
<!--/H-->
    <!-- 内容区 -->
    <div id="main-content">
        <div id="top-alert" class="fixed alert alert-error" style="display: none;">
            <button class="close fixed" style="margin-top: 4px;">&times;</button>
            <div class="alert-content">这是内容</div>
        </div>
        <div id="main" class="main">
            
            <!-- nav -->
                        <!-- nav -->
            

            
	<div class="main-title">
        <h2>创建短信发送任务</h2>
    </div>
    <div class="cf">
	</div>
	    
    <div class="data-table">
        <div class="data-table table-striped">
            <form id='form' method="post" class="form-horizontal">
			<!-----table----->
                        <table class="table table-hover" style="width: 30%;">
				<thead>
				<tr>
					<th width='30%'>选项名称</th>
					<th width='70%'>选项值</th>
				</tr>
				</thead>
				<tbody>
                                    <tr style="height: 40px;">
                                        <td><span style="color:red;">*&nbsp;</span>短信内容：</td>
                                        <td>
                                            <textarea id="content" cols="43" rows="5" placeholder="在此输入短信内容" name="content" style="padding: 5px;"></textarea>
                                        </td>
                                    </tr>
                                    <tr style="height: 40px;">
                                            <td><span style="color:red;">*&nbsp;</span>手机号码：</td>
                                            <td>
                                                <textarea id="mobile" cols="43" rows="8" placeholder="在此输入手机号，如多个手机号用英文逗号‘,’隔开，每次最多支持2万个号码" name="mobile" style="padding: 5px;"></textarea>
                                            </td>
                                    </tr>
                                    <tr style="height: 40px;">
                                            <td><span style="color:red;">*&nbsp;</span>服务商选择：</td>
                                            <td>
                                                <label class="radio" style="cursor:pointer;"><input checked type="radio" name="type" value="kongjianchangxiang" />空间畅想</label>
                                                <!--<label class="radio" style="cursor:pointer;"><input type="radio" name="type" value="chuanglian" />创蓝</label>-->
                                            </td>
                                    </tr>
				</tbody>
			</table>
                        <br/>
                        <span style="color:red;margin-left: 10px;">PS：带*为必填项，手机号最多支持2万个，多余2万请分批发送。</span>
                        <br/>
                        <div class="form-item" style="margin-top: 10px;">
                        <input type='hidden' id="user_type" value="1"/>
                        <a  href="javascript:void(0);" class="btn submit-btn" data-type="submit_yes" target-form="form-horizontal">确定创建并发送</a>
                        </div>
            </form>
			<!-----/table----->
			<!-- 分页 -->
		</div>
    </div>
	
	
			</div>
	</div>
<script type="text/javascript">
    
$(function(){
    var flag = true;
    $(".submit-btn").click(function(){
        if(!flag){
            alert("请不要频繁操作");return;
        }
        var that = this;
        $.ajax({
            url:"{eval echo site_url('sms/sendsms')}",async: false,dataType:"json",type:"post",data:{mobile:$("#mobile").val(),content:$("#content").val()},
            success:function(data){
                flag = true;
		if (data.status==1) {
                    if (data.url) {
                        updateAlert(data.info + ' 页面即将自动跳转~','alert-success');
                    }else{
                        updateAlert(data.info ,'alert-success');
                    }
                    setTimeout(function(){
                        if (data.url) {
                            location.href=data.url;
                        }else if( $(that).hasClass('no-refresh')){
                            $('#top-alert').find('button').click();
                            $(that).removeClass('disabled').prop('disabled',false);
                        }else{
                            location.reload();
                        }
                    },1500);
                }else{
                    updateAlert(data.info);
                    setTimeout(function(){
                        if (data.url) {
                            location.href=data.url;
                        }else{
                            $('#top-alert').find('button').click();
                            $(that).removeClass('disabled').prop('disabled',false);
                        }
                    },1500);
                }
            }
        });
    });
});	
</script>
<!--F-->{load footer}